package start.doubudouyin.mapper;

import org.apache.ibatis.annotations.MapKey;
import start.doubudouyin.entity.UserActiveNum;
import start.doubudouyin.entity.UserGenderNum;
import start.doubudouyin.entity.Usersinfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface UsersinfoMapper extends BaseMapper<Usersinfo> {
    String isPhoneExist(String phone);

    String isIdcardExist(String idcard);

    String UserLogin(String phone, String password);

    Integer isUserOnline(String userId);

    Integer updatelastloginTime(Date lastloginTime, String userId);

    Integer UserRegister(Usersinfo usersinfo);

    Integer updateonlineStatus(Integer onlineStatus, String userId);

    Usersinfo getUserById(String userId);

    Integer UpdatePassword(String phone, String idcard, String password);

    Integer UpdatePasswordById(String userId, String newPassword);

    String VerifyUser(String phone, String idcard);

    String VerifyId(String userId, String idcard);

    String VerifyPassword(String userId, String password);

    String VerifyPhone(String userId, String phone);

    Integer UpdatePhone(String userId, String phone);

    List<Usersinfo> findAll();

    Integer EditPersonal(String nickname, String signature, String userId);

    Integer iconupload(String iconUrl, String userId);

    Integer insertUsersPrefer(String userId);

    //  获取用户30天内注册的用户数量
    @MapKey("userId")
    List<Map<String, Object>> getUserRange30();

    //获取关注的用户的信息
    List<Usersinfo> getFollowedInfo(List<String> followedId);

    //获取性别数量
    UserGenderNum getGenderNum();

    //获取用户活跃度
    UserActiveNum getUserActiveNum();
}




